Skip to content

Test, check and pack the module before a release - #101

Merged
HalRiveria-Bot merged 18 commits into
mainfrom
change/module-workflow
Dec 2, 2026
Merged

HalRiveria-Bot merged 18 commits into
mainfrom
change/module-workflow

Conversation

@HalRiveria-Bot

Copy link
Copy Markdown
Collaborator

A workflow that tests the kit built as a module and packs it for the PowerShell Gallery. It publishes nothing and needs no key: the package is kept with the run, for a person to publish.

.github/workflows/module.yml

  • Runs on a push to a version's branch (release/** or version/**), on a published release, by hand (optionally for a tag), and on a pull request that changes Build/ or the workflow. It isn't a required check.
  • Tests: the harness with -AsModule, on Windows PowerShell 5.1 and PowerShell 7. That's the whole harness on a version's branch and -Section MODULE otherwise.
  • Then, only if both passed: checks a tag against the version in ParallelKit.ps1, builds the module under 5.1 and under 7 and checks the two are identical, runs Test-ModuleManifest, checks for PSScriptAnalyzer errors, packs it with Compress-PSResource, and keeps the package with its SHA-256 sums.
  • PSScriptAnalyzer: it sometimes fails internally ("Object reference not set to an instance of an object"), losing results, or hangs (seen on 1 of 20 runs here). So it runs in a process of its own, with a time limit, and only a run without that error counts, up to five tries. PSScriptAnalyzer and PSResourceGet are installed on the runner only if they're missing.

The README's testing section says what it runs.

Tests

  • The package job's steps, run locally on 5.1 and 7 the way the runner runs them: both builds identical, the manifest valid, no PSScriptAnalyzer errors (63 warnings), one package with its sums. A tag that doesn't match the version stops it with a message.
  • No kit or harness change: the code is what Build the kit as a PowerShell module, and test it that way #100 tested.
  • This pull request runs the workflow's test jobs and package job, since it changes the workflow.

🤖 Generated with Claude Code

HalRiveria and others added 18 commits December 1, 2026 16:12
Two of the batch's own closures called Complete-PkProcess and Write-PkMessage
by name. A .GetNewClosure() block only sees global functions, so a batch failed
with "'Complete-PkProcess' is not recognized" when the kit was loaded for one
module only. They're captured up front now, like the private helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A worker given the function (-SharedFunctionNames takes it) could set a handler
made in its own runspace, which the main thread then ran for every message.
Running another runspace's scriptblock can hang or crash PowerShell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It only looked for an abort after its first 200 ms wait, so a program that
finished sooner ran to the end and returned normally, and a slower one ran for
about 200 ms before it was killed. It now throws before starting the program,
unless -IgnoreAbort is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… GetNewClosure

DelegateCast missed a scriptblock passed to .NET as ({ 1 }), { 1 }.GetNewClosure(),
[scriptblock]{ 1 } and the like, in the call or through a variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Invoke-PkRunspaceJobs is Invoke-PkRunspaceBatch, and 13 private functions lose
their plural names. -MaxConcurrent and -AbortTimeoutSeconds are the only names
on every engine: -MaxParallel and -DrainTimeoutSeconds are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Initialize-ParallelKit loses -MaxConcurrentProcesses and ThreadPool, and the
dispatcher its -AbortPollCallback alias. Code nothing reaches goes too. The
stale-types message says "a different version". Two functions declare their
output type. The comments are shorter and checked against the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	ParallelKit.Harness.ps1
#	ParallelKit.ps1
Build/New-ParallelKitModule.ps1 makes ParallelKit.psm1 and its manifest from
ParallelKit.ps1. The harness can run on that module (-AsModule), and CI runs the
sections where loading can matter on it. The README covers the module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new workflow runs the harness on the module, checks that it builds the same
under 5.1 and 7 and that PSScriptAnalyzer reports no errors, and keeps the
packed module with the run. It publishes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria-Bot
HalRiveria-Bot merged commit 9abd1d7 into main Dec 2, 2026
5 checks passed
@HalRiveria-Bot
HalRiveria-Bot deleted the change/module-workflow branch December 2, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants